<?php

namespace Zilla\FrontBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Zilla\FrontBundle\Entity\Store
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Zilla\FrontBundle\Entity\StoreRepository")
 */
class Store
{

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $title
     *
     * @ORM\Column(name="title", type="string", length=255)
     */
    private $title;

    /**
     *  @var datetime $createdAt
     * 
     * @Gedmo\Timestampable(on="create") 
     * @ORM\Column(name="created_at", type="datetime")
     */
    private $createdAt;
    
    /**
     *  @var datetime $updatedAt
     * 
     * @Gedmo\Timestampable(on="update") 
     * @ORM\Column(name="updated_at", type="datetime")
     */
    private $updatedAt;
    
    /**
     *  @var datetime $lastNotifiedDate
     *  
     * @ORM\Column(name="last_notified_date", type="datetime")
     */
    private $lastNotifiedDate;
    
    /**
     *  @var datetime $lastModifiedDate
     *  
     * @ORM\Column(name="last_modified_date", type="datetime")
     */
    private $lastModifiedDate;

    /**
     * 
     * @var string $alias
     * 
     * @Gedmo\Slug(fields={"title"})
     * @ORM\Column(name="alias",length=255, unique=true)
     */
    private $alias;
    
    /**
     * 
     * @var ArrayCollection $products
     * 
     * @ORM\OneToMany(targetEntity="Product", mappedBy="store")
     */
    private $products;
    
    /**
     * 
     * Bidirectional 
     * 
     * @var ArrayCollection $proFollowers
     * 
     * @ORM\ManyToMany(targetEntity="ProWinker", inversedBy="winkedStores")
     * @ORM\JoinTable(name="_prowinker_follows_store",
     *      joinColumns={@ORM\JoinColumn(name="store_id", referencedColumnName="id")},
     *      inverseJoinColumns={@ORM\JoinColumn(name="prowinker_id", referencedColumnName="id")}
     * )
     */
    private $proFollowers;

    /**
     * 
     * Bidirectional 
     * 
     * @var ProWinker $owner
     * 
     * @ORM\ManyToOne(targetEntity="ProWinker", inversedBy="stores")
     * @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
     */
    private $owner;
    
    /**
     * 
     * Unidirectional 
     * 
     * @var Theme $theme
     * 
     * @ORM\ManyToOne(targetEntity="Theme")
     * @ORM\JoinColumn(name="theme_id", referencedColumnName="id")
     */
    private $theme;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     * @return Store
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }
    
        /**
     *
     * @return datetime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     *
     * @param datetime $createdAt
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;
    }
    
    /**
     *
     * @return datetime
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     *
     * @param datetime $updatedAt 
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;
    }
    
    /**
     * 
     * @return datetime
     */
    public function getLastNotifiedDate()
    {
        return $this->lastNotifiedDate;
    }

    /**
     * 
     * @var datetime $lastNotifiedDate
     */
    public function setLastNotifiedDate($lastNotifiedDate)
    {
        $this->lastNotifiedDate = $lastNotifiedDate;
    }

    /**
     * 
     * @return datetime
     */    
    public function getLastModifiedDate()
    {
        return $this->lastModifiedDate;
    }

    /**
     * 
     * @var datetime $lastModifiedDate
     */
    public function setLastModifiedDate($lastModifiedDate)
    {
        $this->lastModifiedDate = $lastModifiedDate;
    }

    /**
     *
     * @return string
     */
    public function getAlias()
    {
        return $this->alias;
    }

    /**
     *
     * @param string $alias 
     */
    public function setAlias($alias)
    {
        $this->alias = $alias;
    }

    /**
     *
     * @return ArrayCollection
     */
    public function getProducts()
    {
        return $this->products;
    }

    /**
     *
     * @param ArrayCollection $products 
     */
    public function setProducts(ArrayCollection $products)
    {
        $this->products = $products;
    }

    /**
     *
     * @param Product $product 
     */
    public function addProduct(Product $product)
    {
        $this->products->add($product);
    }
    
    /**
     *
     * @return ArrayCollection
     */
    public function getProFollowers()
    {
        return $this->proFollowers;
    }

    /**
     * 
     * @param ArrayCollection $proFollowers
     */
    public function setProFollowers(ArrayCollection $proFollowers)
    {
        $this->proFollowers = $proFollowers;
    }
    
    /**
     *
     * @param ProWinker $proFollower 
     */
    public function addProFollower(ProWinker $proFollower)
    {
        $this->proFollowers->add($proFollower);
    }
 
    /**
     *
     * @return ProWinker
     */
    public function getOwner()
    {
        return $this->owner;
    }

    /**
     *
     * @param ProWinker $owner 
     */
    public function setOwner(ProWinker $owner)
    {
        $this->owner = $owner;
    }
    
    /**
     *
     * @return Theme
     */
    public function getTheme()
    {
        return $this->theme;
    }

    /**
     *
     * @param Theme $theme 
     */
    public function setTheme($theme)
    {
        $this->theme = $theme;
    }



}
